<?php echo $this->fetch('header.html'); ?>

<link href="<?php echo $this->res_base . "/" . 'css/detail.css'; ?>" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="<?php echo $this->res_base . "/" . 'js/touchslider.dev.js'; ?>"></script>
<div class="detail_con">
<!--    <ul class="tab">
        <li class="cur">商品主图</li>
        <li class=""><span>商品详情</span></li>
        <li><span><?php echo $this->_var['comments']; ?></span></li>
    </ul>-->
    <div class="tab_con_">
        <?php echo $this->fetch('goodsinfo.html'); ?>
        <?php echo $this->fetch('goods.relation.html'); ?>
    </div>
    <ul class="tab">
        <li class="cur">商品详情</li>
        <li class=""><span>累计评价(<?php echo $this->_var['comments']; ?>)</span></li>
        <li><a href="<?php echo url('app=store&id=' . $this->_var['store']['store_id']. ''); ?>">进入店铺</a></li>
    </ul>
    <div class="tab_con">
            <?php if ($this->_var['props']): ?>
            <div style="background:#F5F5F5;margin-bottom:20px;margin-top:10px;border:1px #E2E2E2 solid;">
               <?php $_from = $this->_var['props']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'prop');if (count($_from)):
    foreach ($_from AS $this->_var['prop']):
?>
               <div style="float:left;width:32%;padding:5px; height:20px; line-height:20px;background:#F5F5F5">
                  <?php echo $this->_var['prop']['name']; ?>：<?php echo $this->_var['prop']['value']; ?>
               </div>
               <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
               <div style="clear:both;height:0; display:block; overflow:hidden"></div>
            </div>
            <?php endif; ?>
        <?php echo html_filter($this->_var['goods']['description']); ?>
    </div>
    <div class="tab_con" style="display:none;">
        <ul class="comments_list">
            <?php $_from = $this->_var['goods_comments']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'comment');if (count($_from)):
    foreach ($_from AS $this->_var['comment']):
?>
            <li>
                <p>
                    <span><?php if ($this->_var['comment']['anonymous']): ?>***<?php else: ?><?php echo htmlspecialchars($this->_var['comment']['buyer_name']); ?><?php endif; ?> (<?php echo local_date("Y-m-d H:i:s",$this->_var['comment']['evaluation_time']); ?>)</span><b style="float:right;margin-right:8px">评分:<?php if ($this->_var['comment']['evaluation'] > 0): ?><img style="width:11px;height:11px;" src="<?php echo $this->res_base . "/" . 'images/bit.gif'; ?>" /><?php endif; ?>
                        <?php if ($this->_var['comment']['evaluation'] > 1): ?><img style="width:11px;height:11px;" src="<?php echo $this->res_base . "/" . 'images/bit.gif'; ?>" /><?php endif; ?>
                        <?php if ($this->_var['comment']['evaluation'] > 2): ?><img style="width:11px;height:11px;" src="<?php echo $this->res_base . "/" . 'images/bit.gif'; ?>" /><?php endif; ?>
                        <?php if ($this->_var['comment']['evaluation'] < 3): ?><img style="width:11px;height:11px;" src="<?php echo $this->res_base . "/" . 'images/bit2.gif'; ?>" /><?php endif; ?>
                        <?php if ($this->_var['comment']['evaluation'] < 2): ?><img style="width:11px;height:11px;" src="<?php echo $this->res_base . "/" . 'images/bit2.gif'; ?>" /><?php endif; ?>
                        <?php if ($this->_var['comment']['evaluation'] < 1): ?><img style="width:11px;height:11px;" src="<?php echo $this->res_base . "/" . 'images/bit2.gif'; ?>" /><?php endif; ?></b>
                </p>
                <p class="con"><?php echo nl2br(htmlspecialchars($this->_var['comment']['comment'])); ?></p>
            </li>
            <?php endforeach; else: ?>
            <li>该商品还没有评论</li>
            <?php endif; unset($_from); ?><?php $this->pop_vars();; ?>
        </ul>
        
    </div>
    <div class="alert_text"></div>
</div>

<script type="text/javascript">
    jQuery(function(jq) {
        function changeTab(lis, divs) {
            lis.each(function(i) {
                var els = jq(this);
                els.click(function() {
                    lis.removeClass();
                    divs.stop().hide().animate({'opacity': 0}, 0);
                    jq(this).addClass("cur");
                    divs.eq(i).show().animate({'opacity': 1}, 300);
                });
            });
        }
        var rrE = jq(".detail_con");
        changeTab(rrE.find(".tab li"), rrE.find(".tab_con"));

    });
        $(function(){
        $("body").find("*").each(function(){
            $(this).load(function(){
                if($(this).width()>$(window).width()){
                    $(this).css("width","100%");
                }
            })
        });
                $(".tab_con img").each(function(){
                var img_src=$(this).attr("src");
                $(this).attr("src",img_src.replace("./data","<?php echo $this->_var['site_url']; ?>/data"));
                
        })

        })
</script>

<?php echo $this->fetch('footer.html'); ?>
